package co.com.inventarios.modelo;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Vinculado entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "VINCULADO", schema = "MANAGER", uniqueConstraints = {})
public class Vinculado implements java.io.Serializable {

	// Fields

	private String vincedula;
	private String vinnombre;
	private Long vinprovee;
	private Long vincliente;
	private Long vinactivo;
	private Timestamp vinlogfec;
	private Dlluser dlluser;
	private Set<Mngdoc> mngdocs = new HashSet<Mngdoc>(0);
	private Set<Producto> productos = new HashSet<Producto>(0);

	// Constructors

	/** default constructor */
	public Vinculado() {
	}

	/** minimal constructor */
	public Vinculado(String vincedula) {
		this.vincedula = vincedula;
	}

	/** full constructor */
	public Vinculado(String vincedula, String vinnombre, Long vinprovee,
			Dlluser dlluser,Timestamp vinlogfec,
			Long vincliente, Long vinactivo, Set<Mngdoc> mngdocs,
			Set<Producto> productos) {
		this.vincedula = vincedula;
		this.vinnombre = vinnombre;
		this.vinprovee = vinprovee;
		this.vincliente = vincliente;
		this.vinlogfec = vinlogfec;
		this.dlluser = dlluser;
		this.vinactivo = vinactivo;
		this.mngdocs = mngdocs;
		this.productos = productos;
	}

	// Property accessors
	@Id
	@Column(name = "VINCEDULA", unique = true, nullable = false, insertable = true, updatable = true, length = 15)
	public String getVincedula() {
		return this.vincedula;
	}

	public void setVincedula(String vincedula) {
		this.vincedula = vincedula;
	}

	@Column(name = "VINNOMBRE", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public String getVinnombre() {
		return this.vinnombre;
	}

	public void setVinnombre(String vinnombre) {
		this.vinnombre = vinnombre;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "VINLOGUSER", unique = false, nullable = true, insertable = true, updatable = true)
	public Dlluser getDlluser() {
		return this.dlluser;
	}

	public void setDlluser(Dlluser dlluser) {
		this.dlluser = dlluser;
	}

	@Column(name = "VINLOGFEC", unique = false, nullable = true, insertable = true, updatable = true)
	public Timestamp getVinlogfec() {
		return this.vinlogfec;
	}

	public void setVinlogfec(Timestamp vinlogfec) {
		this.vinlogfec = vinlogfec;
	}
	
	@Column(name = "VINPROVEE", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getVinprovee() {
		return this.vinprovee;
	}

	public void setVinprovee(Long vinprovee) {
		this.vinprovee = vinprovee;
	}

	@Column(name = "VINCLIENTE", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getVincliente() {
		return this.vincliente;
	}

	public void setVincliente(Long vincliente) {
		this.vincliente = vincliente;
	}

	@Column(name = "VINACTIVO", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getVinactivo() {
		return this.vinactivo;
	}

	public void setVinactivo(Long vinactivo) {
		this.vinactivo = vinactivo;
	}

	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "vinculado")
	public Set<Mngdoc> getMngdocs() {
		return this.mngdocs;
	}

	public void setMngdocs(Set<Mngdoc> mngdocs) {
		this.mngdocs = mngdocs;
	}

	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "vinculado")
	public Set<Producto> getProductos() {
		return this.productos;
	}

	public void setProductos(Set<Producto> productos) {
		this.productos = productos;
	}

}